<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
</head>

<body>

  <script>
    const _searchStrIndexOf = (str, target) => {
      // 补全代码
      // return str.split(target).length - 1
      return str.match(new RegExp(target, 'g')).length
    }
  </script>
</body>

</html>